import os
import shutil

file_path = "/Users/xuyihang/Downloads/总之就是非常可爱 第121-127话"
file_cp_path = "/Users/xuyihang/Downloads/cp"
files = os.listdir( file_path )


def mkdir_path(path):
    filePath = os.path.exists( path )
    if not filePath:
        os.makedirs( path )


def image_cp():
    mkdir_path( file_cp_path )
    for file in files:  # 遍历文件夹
        if os.path.isdir( file_path + '/' + file ):
            imagePath = os.listdir( file_path + '/' + file )
            for image in imagePath:
                shutil.copy( file_path + '/' + file + '/' + image, file_cp_path + '/' + file + "_" + image )


if __name__ == '__main__':
    image_cp()

